package com.zekdot.logserver.writer;

import org.apache.log4j.Logger;

/** 日志写出器，以后可以考虑增加模块后通过读取配置自动生成logger的功能
 * Create by zekdot on 20-3-19.
 */
public class LogWriter {
    private static Logger infoLogger = Logger.getLogger("I");

    private static Logger errorLogger = Logger.getLogger("E");

    /**
     *
     * @param content 日志内容
     * @param type 0-信息 1-错误
     */
    public static void writeLog(String content,int type){
        switch (type){
            case 0:
                infoLogger.info(content);
                break;
            case 1:
                errorLogger.error(content);
                break;
        }
    }
    public static void main(String args[]){
        writeLog("cdd",0);
    }
}
